package com.app.widgets.BounceLoadingViewDemo;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.app.widgets.R;
import com.zndroid.widget.ProgressView.BounceLoadingView;

public class MainActivity extends AppCompatActivity {

    private BounceLoadingView loadingView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_bounce_loading);


        loadingView = (BounceLoadingView) findViewById(R.id.loadingView);

        loadingView.addBitmap(R.mipmap.v4);
        loadingView.addBitmap(R.mipmap.v5);
        loadingView.addBitmap(R.mipmap.v6);
        loadingView.addBitmap(R.mipmap.v7);
        loadingView.addBitmap(R.mipmap.v8);
        loadingView.addBitmap(R.mipmap.v9);
        loadingView.setShadowColor(Color.LTGRAY);
        loadingView.setDuration(700);
        loadingView.start();
    }

    public void start(View view) {
        loadingView.stop();
        loadingView.start();
    }
    public void stop(View view) {
        loadingView.stop();
    }
}
